package com.woniu.client;

import com.woniu.commons.model.Result;
import com.woniu.model.UserDto;
import com.woniu.model.model.YCoach;
import com.woniu.model.model.YUser;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;


@FeignClient(name = "account-server",path = "/account")
public interface AccountClient {
    /**
     * 根据id查找用户信息
     * @param id
     * @return
     */
    @GetMapping("/byId/{id}")
    @ApiOperation("根据id查找用户信息")
    public Result<UserDto> byId(@PathVariable("id") Integer id);

    /**
     * 根据id查找用户信息
     * @param userId
     * @return
     */
    @GetMapping("/yUser/loadUsersByIds")
    @ApiOperation("根据id查找用户信息")
    Result<YUser> loadUsersByIds(@RequestParam("userId") Integer userId);


    /**
     * 根据id查找教练信息
     *
     * @param id:教练id
     * @return 对象
     */
    @GetMapping("/yCoach/byId/{id}")
    @ApiOperation("根据id查找教练信息")
    public Result<YCoach> byCoachId(@PathVariable("id") Integer id);

    /**
     * 根据id查找教练信息
     * @param coachId
     * @return
     */
    @GetMapping("/yCoach/loadCoachById")
    @ApiOperation("根据id查找教练信息")
    Result<YCoach> loadCoachById(@RequestParam("coachId") Integer coachId);
}
